package com.server.process;

import com.server.common.utils.IdWorker;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Bean;

/**
 * 1.配置springboot的包扫描
 * @SpringBootApplication
 * 2.配置jpa注解的扫描
 * @EntityScan
 * jpa注解扫描与实体类相关
 */

@SpringBootApplication(scanBasePackages = "com.server.process")
@EntityScan(value = "com.server.domain.process")
public class ProcessApplication {
    /**
     * 启动方法
     */
    public static void main(String[] args) {
        SpringApplication.run(ProcessApplication.class, args);
    }

    /**
     * 为工程注入idworker
     */
    @Bean
    public IdWorker idWorker() {
        return new IdWorker();
    }
}
